package com.gxa.hystrix.controller;

import com.gxa.hystrix.pojo.HuanZheJiuZhenKa;
import com.gxa.hystrix.service.CheckService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author thinknovo
 * @version 1.0
 * @description CheckController.java
 * @date 2021/3/11 9:30
 */
@RestController
@RequestMapping(value = "huanZheJiuZhenKa", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class HuanZheJiuZhenKaController {
    @Resource
    private CheckService checkService;

    /*
    这里类似于ribbon，提供一个对外访问的接口地址，
    然后根据serviceFeignByCheck接口来决定调用哪一个子模块服务和哪一个接口地址
     */
    @GetMapping("chaXunAll")
    public Map<String, Object> huanZheJiuZhenKaChaXunAll() {
        return this.checkService.huanZheJiuZhenKaChaXunAll();
    }

    @PostMapping("gengXinById")
    public Map<String, Object> huanZheJiuZhenKaGengXinById(@RequestBody HuanZheJiuZhenKa huanZheJiuZhenKa) {
        return this.checkService.huanZheJiuZhenKaGengXinById(huanZheJiuZhenKa);
    }

    @GetMapping("chaXunByKaHao")
    public Map<String, Object> huanZheJiuZhenKaChaXunByKaHao(String huanZheKaHao,String shenFenZheng,String xingMing,
                                             String shouJiHao,String kaiShiShiJian,String jieShuShiJian) {
        return this.checkService.huanZheJiuZhenKaChaXunByKaHao(huanZheKaHao,shenFenZheng,xingMing,shouJiHao,kaiShiShiJian,jieShuShiJian);
    }


}
